function InvoiceModel() {
	this.parent();
}

InvoiceModel.inherits(BaseModel, {

});

function createInvoiceModel(data) {
	var invoice = data.getElementsByTagName("order");
	var arrInvoice = [];
	var orderId, userId, receiveAddress, receivePhoneNumber, orderDate, receiverName, shippingMethod, paymentMethod, totalPrice, status;
	for (var i = 0; i < invoice.length; i++) {
		orderId = invoice[i].getElementsByTagName("orderId")[0].childNodes[0].nodeValue;
		userId = invoice[i].getElementsByTagName("userId")[0].childNodes[0].nodeValue;
		receiveAddress = invoice[i].getElementsByTagName("receiveAddress")[0].childNodes[0].nodeValue;
		receivePhoneNumber = invoice[i].getElementsByTagName("receivePhone")[0].childNodes[0].nodeValue;
		orderDate = invoice[i].getElementsByTagName("orderDate")[0].childNodes[0].nodeValue;
		receiverName = invoice[i].getElementsByTagName("receiverName")[0].childNodes[0].nodeValue;
		shippingMethod = invoice[i].getElementsByTagName("shippingMethod")[0].childNodes[0].nodeValue;
		paymentMethod = invoice[i].getElementsByTagName("paymentMethod")[0].childNodes[0].nodeValue;
		totalPrice = invoice[i].getElementsByTagName("totalPrice")[0].childNodes[0].nodeValue;
		status = invoice[i].getElementsByTagName("status")[0].childNodes[0].nodeValue;	
		
		arrInvoice[i] = {
			"orderId" : orderId,
			"userId" : userId,
			"receiveAddress" : receiveAddress,
			"receivePhoneNumber" : receivePhoneNumber,
			"orderDate" : orderDate,
			"receiverName" : receiverName,
			"shippingMethod" : shippingMethod,
			"paymentMethod" : paymentMethod,
			"totalPrice" : totalPrice,
			"status" : status,
		}	
	}

	return new BookOrderPage(arrInvoice);
}

var BookOrderPage = function(orderList) {
	this.orderList = orderList;
}
var BookOrder = function(orderId, ownerId, totalPrice, orderDate, dateReceive, status) {
	this.orderId = orderId;
	this.ownerId = ownerId;
	this.totalPrice = totalPrice;
	this.orderDate = orderDate;
	this.dateReceive = dateReceive;
	this.status = status;
}
var BookOrderDetail = function(orderId, userId, receiveMessage, receivePhoneNumber, orderDate, receivePersonalName, shippingMethod, paymentMethod, price, status) {
	this.orderId = orderId;
	this.userId = userId;
	this.receiveMessage = receiveMessage;
	this.receivePhoneNumber = receivePhoneNumber;
	this.orderDate = orderDate;
	this.receivePersonalName = receivePersonalName;
	this.shippingMethod = shippingMethod;
	this.paymentMethod = paymentMethod;
	this.price = price;
	this.status = status;
}
var BookOrderDetailPerBook = function(bookName, bookAuthor, quantity, totalPrice) {
	this.bookName = bookName;
	this.bookAuthor = bookAuthor;
	this.quantity = quantity;
	this.totalPrice = totalPrice;
}
